< previous page page_157 next page >

Page 157
The image does not look quite right yet. At the lower portion of the image, the vectors go off the bottom. It's almost as if the calculations are not based on the true dimensions of the window. As it turns out, that's probably because the calculations are not based on the true dimensions of the window. The Height and Width properties of a form reflect the dimensions of the entire window. The image appears only in the client area of the form (excluding the border and caption areas). The client area for a window can be obtained using an API function called GetClientRect or using the ScaleWidth and ScaleHeight properties of the form, the solution that is used here:
LoadPointArray ScaleWidth / Screen.TwipsPerPixelX, ScaleHeight / _
Screen.TwipsPerPixelY, 5, points()
0157-01.gif
Figure S3-2:
Another version of the Poly program
And with that, the sample works perfectly.
One last question: You may note that there is a vertical line on the left side of the drawing. Can you tell where it comes from?

 
< previous page page_157 next page >